<template>

	<view class="main">
		<u-navbar :fixed="false" title="订单详情" @rightClick="rightClick" :autoBack="true"></u-navbar>






		<view class=" column_c">

			<view class="card-content" style="margin-top: 30rpx;">

				<view class="hzxx">患者信息</view>
				<u-line margin="30rpx 0 30rpx 0"></u-line>


				<view class="row_a_c space-between item-a">
					<text class="clinic">姓名</text>
					<text class="status  center">{{dataInfo.user.name}}</text>
				</view>

				<view class="row_a_c space-between item-a">
					<text class="clinic">病历号</text>
					<text class="status  center">{{dataInfo.user.id}}</text>
				</view>

				<view class="row_a_c space-between item-a">
					<text class="clinic">联系电话</text>
					<text class="status  center">{{dataInfo.user.phone}}</text>
				</view>

			</view>

			<view class="card-content">

				<view class="hzxx">消费信息</view>
				<u-line margin="30rpx 0 30rpx 0"></u-line>

				<view class="row_a_c space-between item-a">
					<text class="clinic">就诊项目</text>
					<text class="status  center">{{dataInfo.territory.name}}</text>
				</view>

				<view class="row_a_c space-between item-a">
					<text class="clinic">消费门店</text>
					<text class="status  center">{{dataInfo.store.name}}</text>
				</view>

				<view class="row_a_c space-between item-a">
					<text class="clinic">交易金额</text>
					<text class="status  center" style="color: red;">￥{{dataInfo.amount}}</text>
				</view>

				<view class="row_a_c space-between item-a">
					<text class="clinic">订单编号</text>
					<text class="status  center">{{dataInfo.number}}</text>
				</view>

				<view class="row_a_c space-between item-a">
					<text class="clinic">创建时间</text>
					<text class="status  center">{{dataInfo.created_at}}</text>
				</view>

				<view class="row_a_c space-between item-a">
					<text class="clinic">支付方式</text>
					<text class="status  center">{{dataInfo.payment_way}}</text>
				</view>

				<view class="row_a_c space-between item-a">
					<text class="clinic">订单备注</text>
					<text class="status  center" v-if="dataInfo.remark">{{dataInfo.remark}}</text>
				</view>


				<!-- <view class="row space-between item-a">
					<text class="clinic">订单图片</text>
					<view class="row">
						<image class="ysh" src="/static/images/ysh.png"></image>
						<image class="ysh" src="/static/images/ysh.png"></image>
						<image class="ysh" src="/static/images/ysh.png"></image>
					</view>
				</view> -->

			</view>




		</view>




	</view>

</template>

<script>
	import api_charge from '@/api/charge.js';

	export default {
		async onLoad(option) {
			this.record = option.id;
		},

		async onShow() {
			this.access_token = uni.getStorageSync('access_token');
			if (!this.access_token) {
				uni.navigateTo({
					url: '/pages/auth/login'
				});
			} else {
				this.getchargeRecordDetailFuc(); // 查看消费记录详情
			}
		},
		data() {
			return {
				record: null,
				access_token: null,
				bgColor: 'rgba(0, 31, 63, 0)',
				dataInfo: []
			};
		},
		methods: {
			// 查看消费记录详情
			async getchargeRecordDetailFuc() {
				var per = {
					record: this.record,
				}
				const res = await api_charge.getchargeRecordDetail(per);
				if (res.code == 1) {
					this.dataInfo = res.data.info
				} else {
					this.$util.msg(res.message);
					return;
				}
			},
		}
	};
</script>

<style scoped lang="scss">
	.main {
		background: #FAFAFA;
		height: 100vh;
	}

	.bit {
		padding: 32rpx;
	}

	.but {

		width: 290rpx;
		height: 60rpx;
		background: #FFFFFF;
		border-radius: 50rpx 50rpx 50rpx 50rpx;
		padding: 0 30rpx;
	}

	.time {
		font-weight: 400;
		font-size: 28rpx;
		color: #7F7F7F;
	}

	.xltb {
		width: 32rpx;
		height: 32rpx;
	}


	.container {
		padding: 0;
	}

	.card {
		background-color: #fff;
		border-radius: 8px;
		box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
		margin-bottom: 20px;
	}

	.card-header {
		display: flex;
		justify-content: space-between;
		padding: 10px;
		border-bottom: 1px solid #f0f0f0;
	}

	.item-a {
		margin-bottom: 32rpx;
	}

	.status {
		font-weight: 400;
		font-size: 28rpx;
		color: rgba(0, 0, 0, 0.85);
	}

	.clinic {
		font-weight: 400;
		font-size: 28rpx;
		color: rgba(0, 0, 0, 0.6);
	}


	.cancelled {
		color: #f44336;
	}

	.card-content {
		width: 686rpx;
		min-height: 200rpx;
		background: #FFFFFF;
		box-shadow: 0rpx 0rpx 8rpx -2rpx rgba(0, 0, 0, 0.04), 0rpx 0rpx 10rpx 0rpx rgba(0, 0, 0, 0.03), 0rpx 0rpx 20rpx 0rpx rgba(0, 0, 0, 0.02);
		border-radius: 20rpx 20rpx 20rpx 20rpx;
		padding: 32rpx 32rpx 0 32rpx;
		margin-bottom: 20rpx;

	}



	.name {
		font-weight: 400;
		font-size: 24rpx;
		color: rgba(0, 0, 0, 0.6);
		margin-bottom: 12rpx;

	}

	.time {
		font-weight: 400;
		font-size: 24rpx;
		color: rgba(0, 0, 0, 0.6);
		margin-bottom: 12rpx;
	}



	.appointment-info {
		margin-top: 20rpx;
	}

	.hzxx {
		font-weight: 600;
		font-size: 28rpx;
		color: rgba(0, 0, 0, 0.85);
	}

	.ysh {
		width: 160rpx;
		height: 160rpx;
		margin-left: 10rpx;
	}
</style>